#include <my_head.h>
void sig_func(int signum){
    if(SIGPIPE == signum){
        printf("捕捉到了一个管道破裂信号\n");
    }
}
int main(int argc, const char *argv[]){
    signal(SIGPIPE,sig_func);//捕捉管道破裂信号
    int pipefd[2];//无名管道
    if(-1 == pipe(pipefd))
        ERR_LOG("pipe error");
    close(pipefd[0]);
    write(pipefd[1],"hello",5);
    printf("执行完了write函数\n");
    close(pipefd[1]);
    return 0;
}